<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="funA()">back</button>
<button onclick="funB()">forward</button>
<button onclick="funC()">go</button>
</body>
</html>
<script>
    function funA() {
        window.history.back();
    }

    function funB() {
        window.history.forward();
    }

    function funC() {
        window.history.go(-2);
    }
</script>